#!/bin/bash

echo "=== 修复版RTAB-Map启动 ==="

source /opt/ros/humble/setup.bash

# 使用修复后的参数
ros2 launch rtabmap_launch rtabmap.launch.py \
    rtabmap_args:="--delete_db_on_start --Mem/IncrementalMemory true" \
    frame_id:=camera_link \
    rgb_topic:=/camera/color/image_raw \
    depth_topic:=/camera/depth/image_rect_raw \
    camera_info_topic:=/camera/color/camera_info \
    approx_sync:=true \
    approx_sync_max_interval:=0.05 \
    wait_imu_to_init:=true \
    imu_topic:=/camera/imu \
    subscribe_odom_info:=true \
    odom_topic:=/camera/odom/sample \
    rtabmap_viz:=true \
    rviz:=true \
    rgbd_odometry:=false \
    args:="--Icp/CorrespondenceRatio 0.1 --Vis/CorNNDR 0.6 --Vis/MaxFeatures 500 --Kp/DetectorStrategy 6 --Odom/Strategy 0 --Mem/RehearsalSimilarity 0.6"
